<!--背景色组件-->
<template>
  <el-form-item label="背景颜色">
    <el-color-picker
        show-alpha
        size="small"
        :predefine="predefineColors"
        v-model="optionsInfo.backgroundColor"
    />
  </el-form-item>
</template>

<script>
import constantDic from "@/utils/vue-i18n/lang/zh-CN";
import * as types from "@c/public/form-designer/devType/datas-types";

export default {
  name: "background-editor",

  componentName: "background-editor",

  mixins: [],

  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object,
  },

  data() {
    return {
      optionsInfo:Object(),
      constantDic: constantDic,
      predefineColors: types['predefineColors'],
    }
  },

  watch: {
    optionModel: {
      handler: function (val) {
        let key = val.config;
        this.optionsInfo = (val[key]);
      },
      deep: true,
      immediate: true
    }
  }
}
</script>
